package br.com.datatraffic.fiscal.entidades;

// Generated 10/07/2009 10:49:54 by Hibernate Tools 3.2.0.b9

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;

/**
 * CuidadoEspecial generated by hbm2java
 */
@Entity
@Table(name = "TBMOTIVO")
public class Motivo implements java.io.Serializable {

	private Long id;
	private String nome;
	private String descricao;
	private List<TicketMotivo> ticketMotivos = new ArrayList<TicketMotivo>(0);

	public Motivo() {
	}

	public Motivo(Long id, String nome, String descricao, List<TicketMotivo> ticketMotivos) {
		this.id = id;
		this.nome = nome;
		this.descricao = descricao;
		this.ticketMotivos = ticketMotivos;
	}

	@Id
	@SequenceGenerator(name = "SQ_TBMOTIVO", sequenceName = "SQ_TBMOTIVO", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_TBMOTIVO")
	@Column(name = "MOTIVO_ID", unique = true, nullable = false, precision = 38, scale = 0)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "NOME", nullable = false, length = 50)
	public String getNome() {
		return this.nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	@Column(name = "DESCRICAO", length = 100)
	public String getDescricao() {
		return this.descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "motivo")
	public List<TicketMotivo> getTicketMotivos() {
		return ticketMotivos;
	}

	public void setTicketMotivos(List<TicketMotivo> ticketMotivos) {
		this.ticketMotivos = ticketMotivos;
	}

	// The following is extra code specified in the hbm.xml files
	private static final long serialVersionUID = 1L;
	// end of extra code specified in the hbm.xml files

}
